package com.ss.android.article.base.feature.category.activity;

import com.ss.android.article.base.app.AppData;
import com.ss.android.article.base.feature.app.a.ArticleConstants;
import com.ss.android.article.base.feature.subscribe.activity.j;
import com.ss.android.newmedia.util.AppUtil;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

public final class a extends j {
    public a() {

    }

    public final String a() {
        char v1_2;
        StringBuilder v3;
        String v0 = null;
        if (!android.support.design.a.isTextEmpty(this.l)) {
            try {
                StringBuilder v2 = new StringBuilder(
                        String.format(ArticleConstants.apiWapSearchUrl,
                                "search_channel",
                                URLEncoder.encode(this.l, "UTF-8")));
                AppUtil.a(v2);
                String v1_1 = v2.indexOf("#") > 0 ? "&" : "#";
                v2.append(v1_1);
                v3 = v2.append("tt_daymode=");
                AppData.getInstance();
                if (AppData.isNightMode()) {
                    v1_2 = '0';
                } else {
                    v1_2 = '1';
                }
                v3.append(v1_2);
                v0 = v2.toString();
            } catch (UnsupportedEncodingException unsupportedEncodingException) {
                unsupportedEncodingException.printStackTrace();
            }
        }

        return v0;
    }
}

